package com.aegean.MonitorExamSYS.conduction.action;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.aegean.MonitorExaxSYS.model.CenterValue;
import com.aegean.MonitorExaxSYS.model.ConductionValue;
import com.opensymphony.xwork2.ActionSupport;

@Controller("ShowConductionInfo")
@Scope("prototype")
public class ShowConductionInfo extends ActionSupport {
	private ConductionValue conduction;
	private int total;
	private boolean success;
	private String msg;

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}


	public ConductionValue getConduction() {
		return conduction;
	}

	public void setConduction(ConductionValue conduction) {
		this.conduction = conduction;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		try {
			HttpSession session = (HttpSession) ServletActionContext
					.getRequest().getSession();
			conduction = (ConductionValue) session.getAttribute("ConductionLogin");
			total = 1;
			success = true;
		} catch (Exception e) {
			// TODO: handle exception
			success = false;
			msg="对不起，用户读取失败";
			e.printStackTrace();
		}
		return SUCCESS;
	}
}
